<%@ page contentType="text/html; charset=UTF-8" %>
<jsp:include page="header.jsp"/>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>

<c:set var="userId" value="${USER.userId}"/>

<div id="content">
    <div class="container san-serif-font">
        <div class="login-head">
            <h3>Quản lý tài khoản</h3>
        </div>
        <div class="edit-body">
            <div class="register-region float-left">
                <h4>Thông tin tài khoản</h4>
                <form id="editInfoForm" action="updateAccount" method="POST">
                    <p>
                        <label class="label">Tên đăng nhập</label>
                    </p>
                    <p>
                        <input name="username" id="username" class="input medium-input" disabled="true" value="${USER.username}"/>
                    </p>
                    <p>
                        <label class="label">Tên đầy đủ</label>
                    </p>
                    <p>
                        <input name="fullname" id="fullname" class="input medium-input" value="${USER.fullName}"/>
                    </p>
                    <div id="fullnameInfo"></div>
                    <p>
                        <label class="label">Email</label>
                    </p>
                    <p>
                        <input name="email" id="email" class="input medium-input" value="${USER.email}"/>
                    </p>
                    <div id="emailInfo"></div>
                    <div class="text-right">
                        <input type="submit" id="btUpdateInfo" value="Cập nhật thông tin" class="big-nice-button"/>
                    </div>
                </form>
            </div>
            <div class="register-region float-right">
                <h4>Đổi password</h4>
                <form id="editPasswordForm" action="updatePassword" method="POST">
                    <p>
                        <label class="label">Mật khẩu hiện tại</label>
                    </p>
                    <p>
                        <input type="password" name="password" id="txtPassword" class="input medium-input" />
                    </p>
                    <div id="passwordInfo"></div>

                    <p>
                        <label class="label">Mật khẩu mới</label>
                    </p>
                    <p>
                        <input type="password" name="newPassword" id="txtNewPassword" class="input medium-input" />
                    </p>
                    <div id="newPasswordInfo"></div>

                    <p>
                        <label class="label">Xác nhận mật khẩu mới</label>
                    </p>
                    <p>
                        <input type="password" name="confirm" id="txtConfirm" class="input medium-input" />
                    </p>
                    <div id="confirmInfo"></div>
                    <div class="text-right">
                        <input type="submit" id="btUpdatePassword" value="Đổi mật khẩu" class="big-nice-button"/>
                    </div>
                </form>
            </div>
        </div>
        <div id="successInfo" align="center" style="font-size: larger"></div>
        <div class="clearfix">
            <h4>Danh sách feed đã thêm</h4>
            <div>
                <c:import url="WEB-INF/dataXML/feed.xml" var="xmldoc" charEncoding="UTF-8"/>
                <c:import url="WEB-INF/xsl/feedInEditAccount.xsl" var="xsldoc" charEncoding="UTF-8"/>
                <x:transform xml="${xmldoc}" xslt="${xsldoc}">
                    <x:param name="userID" value="${userId}"/>
                </x:transform>
            </div>
        </div>
    </div>
</div>
<div class="clearfix"/>
<script type="text/javascript" src="js/ajaxEditUser.js"></script>
<script type="text/javascript" src="js/jsUtils.js"></script>
<script type="text/javascript">
    activeCurrentNav('editNav');
</script>
<jsp:include page="footer.jsp"/>